package com.javasea.patterns.strategy.base;

import com.javasea.patterns.strategy.base.Stock;
import com.javasea.patterns.strategy.base.Strategy;

import java.util.List;

public class Context {
    private Strategy strategy;

    public void setStrategy(Strategy strategy) {
        this.strategy = strategy;
    }

    public List<Stock> getRank(List<Stock> source) {
        return strategy.sort(source);
    }
}
